package com.beiing.tianshuai.tianshuai.mine.presenter;

import com.beiing.tianshuai.tianshuai.base.BasePresenter;
import com.beiing.tianshuai.tianshuai.entity.PersonalAttentionBean;
import com.beiing.tianshuai.tianshuai.mine.model.PersonalAttentionModel;
import com.beiing.tianshuai.tianshuai.mine.model.PersonalAttentionModelImpl;
import com.beiing.tianshuai.tianshuai.mine.view.PersonalAttentionViewImpl;

/**
 * Created by Jinni on 2017/7/31 0031.
 */

public class PersonalAttentionPresenter extends BasePresenter implements PersonalAttentionPresenterImpl, PersonalAttentionModel.OnRequestListener{

    private PersonalAttentionModelImpl mModel;
    private PersonalAttentionViewImpl mView;

    public PersonalAttentionPresenter(PersonalAttentionViewImpl view) {
        mView = view;
        mModel = new PersonalAttentionModel(this);
    }

    @Override
    public void getPersonalAttentionResult(String uid) {
        mView.showProgress();
        mModel.getPersonalAttentionResult(uid);
    }

    @Override
    public void onSuccess(PersonalAttentionBean bean) {
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onError(Throwable e) {
        mView.hideProgress();
        mView.onRequestFailed(e);
    }
}
